/**
  ******************************************************************************
  * @file    bsp_power.h
  * @author  Iron
  * @date    2018-08-30
  * @version v1.0
  * @brief   bsp_power header file
  */

#ifndef __BSP_POWER_H
#define __BSP_POWER_H

#ifdef __cplusplus
extern "C" {
#endif

/* includes ------------------------------------------------------------------*/
#include <stdint.h>

/* exported types ------------------------------------------------------------*/
/* exported constants --------------------------------------------------------*/
enum
{
    bsp_power_bat,  // 内部电池
    bsp_power_gps,
    bsp_power_gprs,
    bsp_power_sensor,
    bsp_power_max
};

/* exported macro ------------------------------------------------------------*/
#define BSP_POWER_OFF  0
#define BSP_POWER_ON   1

#define BSP_BAT_POWER_VOLTAGE              4500   // mV
#define BSP_BAT_POWER_SHUTDOWM_DELAY_MS    60000  // ms

/* exported functions ------------------------------------------------------- */
void bsp_power_init(void);
void bsp_power_set(int32_t port, int32_t state);
int32_t bsp_power_bat_charge_state(void);
int32_t bsp_power_check(void);

/**
  * @}
  */

#ifdef __cplusplus
}
#endif

#endif /* __BSP_POWER_H */

/******************* (C)COPYRIGHT 2018 ***** END OF FILE *********************/
